package com.exam.controller;

import com.exam.pojo.domain.ExamHistory;
import com.exam.pojo.dto.ExamHistoryDTO;
import com.exam.pojo.vo.ExamHistoryVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import com.exam.service.IExamHistoryService;

import lombok.RequiredArgsConstructor;

import java.util.List;

@RestController
@RequestMapping("/examHistory")
@RequiredArgsConstructor
@Api(tags = "考试记录")
public class ExamHistoryController {

  private final IExamHistoryService examHistoryService;

  @GetMapping("/{uuid}")
  @ApiOperation("查询用户的考试记录")
  public List<ExamHistoryVO> listByUUid(@PathVariable String uuid){
      return examHistoryService.listByUUid(uuid);
  }
  @PostMapping("/add")
  @ApiOperation("添加考试记录")
  public void add(@RequestBody ExamHistoryDTO dto){
      examHistoryService.add(dto);
  }
}
